-
Notifications
You must be signed in to change notification settings - Fork 2
Enable energy_reset buttons for all non-plus energy devices #317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdded a documentation bullet in CHANGELOG.md and fixed a broken Markdown link. In Changes
Sequence Diagram(s)sequenceDiagram
participant HA as Home Assistant
participant Coord as DataUpdateCoordinator
participant Btn as PlugwiseUSBButtonEntity
HA->>Coord: trigger refresh / schedule update
Coord-->>Btn: notify coordinator update
rect rgba(200,230,255,0.25)
note right of Btn: New @callback method accepts notifications
Btn->>Btn: _handle_coordinator_update()
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
CHANGELOG.md (1)
321-323: Broken markdown link formattingThere’s a bracket/parenthesis mismatch breaking the link.
Apply this diff:
-- Smile bugfix: fixing [plugwise module 192](https://github.com/plugwise/python-plugwise/issues/192) and [Core Issue 72305](https://github.com/home-assistant/core/issues/72305) - via plugwise module [v0.18.5)[https://github.com/plugwise/python-plugwise/releases/tag/v0.18.5] +- Smile bugfix: fixing [plugwise module 192](https://github.com/plugwise/python-plugwise/issues/192) and [Core Issue 72305](https://github.com/home-assistant/core/issues/72305) + via plugwise module [v0.18.5](https://github.com/plugwise/python-plugwise/releases/tag/v0.18.5)
🧹 Nitpick comments (1)
custom_components/plugwise_usb/button.py (1)
115-118: No-op coordinator callback: optional to keep, safe to removeThe empty
_handle_coordinator_updateis fine for buttons (no state to update). If the base class doesn’t rely on its presence, consider removing to avoid registering a no-op.Apply this diff to remove it:
- @callback - def _handle_coordinator_update(self) -> None: - """Handle updated data from the coordinator.""" -
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
CHANGELOG.md(1 hunks)custom_components/plugwise_usb/button.py(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
custom_components/plugwise_usb/button.py (4)
custom_components/plugwise_usb/number.py (1)
_handle_coordinator_update(166-180)custom_components/plugwise_usb/sensor.py (1)
_handle_coordinator_update(223-242)custom_components/plugwise_usb/binary_sensor.py (1)
_handle_coordinator_update(104-124)custom_components/plugwise_usb/switch.py (1)
_handle_coordinator_update(141-156)
🔇 Additional comments (3)
CHANGELOG.md (1)
5-8: Changelog entry looks good and matches the PR intentThe new “Ongoing” section and bullet succinctly describe the change.
custom_components/plugwise_usb/button.py (2)
13-13: Importingcallbackis appropriateRequired for the new
@callbackmethod. No issues.
43-49: Verify feature gating covers “all non‑plus energy devices”The energy reset button is currently gated on
node_feature=NodeFeature.CIRCLE. Please confirm this feature is present on all non‑plus energy devices you intend to support (e.g., Circle, Stealth, Plug variants). If some non‑plus energy devices only exposeNodeFeature.ENERGY, you may need to gate onNodeFeature.ENERGYinstead, or broaden the condition to include multiple features to meet the PR objective while avoiding duplicates on Plus devices.Would you like me to draft a follow-up patch that gates on
NodeFeature.ENERGYand explicitly excludes Plus devices if needed?
this should make the energy_reset buttons available again
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work, but may take a short while before button come enabled.



Summary by CodeRabbit